<template>
  <a-modal
    :visible="visible"
    :dialog-style="{ top: '10px' }"
    width="85%"
    :title="title"
    :footer="null"
    destroyOnClose
    @cancel="handleCancel"
  >
    <PDFPreview :url="url" />
  </a-modal>
</template>

<script>
import PDFPreview from './index';

export default {
  name: 'PDFPreviewModal',
  props: {
    visible: {
      type: Boolean,
      default: () => false,
    },
    url: {
      type: String,
      default: () => '',
    },
    title: {
      type: String,
      default: () => '',
    },
  },
  data() {
    return {
    };
  },
  mounted() {
  },
  methods: {
    handleCancel() {
      this.$emit('update:visible', false);
    },
  },
  components: {
    PDFPreview,
  },
};
</script>

<style lang="scss" scoped>
::v-deep {
  .vertical-center-modal {
    text-align: center;
    white-space: nowrap;
  }

  .vertical-center-modal:before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    width: 0;
  }

  .vertical-center-modal .ant-modal {
    display: inline-block;
    vertical-align: middle;
    top: 0;
    text-align: left;
  }
}
</style>
